package com.youdianstar.app.common.util;

import android.webkit.WebView;

import com.just.agentweb.AbsAgentWebSettings;
import com.just.agentweb.AgentWeb;
import com.just.agentweb.IAgentWebSettings;

/**
 * File: WebCsSettings
 * Author: 82149 Create: 2021/12/10 16:21
 * Changes (from 2021/12/10)
 * --------------------------------------------------
 * description:
 * ---------------------------------------------------
 */
public class WebCsSettings extends AbsAgentWebSettings {
    public WebCsSettings() {
        super();
    }

    @Override
    protected void bindAgentWebSupport(AgentWeb agentWeb) {

    }

    @Override
    public IAgentWebSettings toSetting(WebView webView) {
        super.toSetting(webView);

        getWebSettings().setTextZoom(100);
        getWebSettings().setJavaScriptEnabled(true);
        getWebSettings().setSupportZoom(true);
        getWebSettings().setBuiltInZoomControls(false);
        getWebSettings().setUseWideViewPort(true);
        getWebSettings().setLoadWithOverviewMode(true);
        getWebSettings().setNeedInitialFocus(true);
        getWebSettings().setDefaultFontSize(20);
        //设置 WebView 支持的最小字体大小，默认为 8
        getWebSettings().setMinimumFontSize(16);
        getWebSettings().setGeolocationEnabled(true);
        return this;
    }
}
